# SPDX-FileCopyrightText: Copyright (c) {% now 'utc', '%Y' %} {{ cookiecutter.full_name }}{% if cookiecutter.affiliation %} / {{ cookiecutter.affiliation }}{% endif %}. All rights reserved.
# SPDX-License-Identifier: {{ cookiecutter._license }}

add_library({{ cookiecutter.operator_slug }} {{ cookiecutter.operator_slug }}.cpp)
add_library(holoscan::{{ cookiecutter.operator_slug }} ALIAS {{ cookiecutter.operator_slug }})

target_include_directories({{ cookiecutter.operator_slug }} PUBLIC
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/operators>
    $<INSTALL_INTERFACE:include>)

target_link_libraries({{ cookiecutter.operator_slug }} PUBLIC holoscan::core)
target_link_libraries(holoscan_{{ cookiecutter.module_slug }} INTERFACE
    holoscan::{{ cookiecutter.operator_slug }})

install(FILES {{ cookiecutter.operator_slug }}.hpp DESTINATION include/{{ cookiecutter.operator_slug }})

# Add the operator to an export set. The package layer installs the set and
# generates the CMake config — see holohub_configure_deb(... EXPORT_NAME ...) in
# pkg/{{ cookiecutter.module_repo_name }}/CMakeLists.txt — so downstream projects
# can find_package({{ cookiecutter.module_repo_name }}) and link
# holoscan::{{ cookiecutter.operator_slug }}.
install(TARGETS {{ cookiecutter.operator_slug }}
    EXPORT holoscan_{{ cookiecutter.module_slug }}_targets)
